Fix CLI install script race condition causing flaky CI tests#389
Fix CLI install script race condition causing flaky CI tests#389
Conversation
- Remove separate curl --head check that created race condition window - Use single curl -L --fail request with retry logic (3 attempts) - Add 2-second delay between retries with progress feedback - Maintains all existing functionality while eliminating timing issues Fixes flaky CI test failures caused by checksum verification mismatches when CDN/cache serves different versions between HEAD and GET requests. Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Fix CLI Install Script Race Condition
Problem
The CLI CI tests have been flaky for the past week, failing intermittently with checksum verification errors like:
Root Cause
The install script's
download_release()function had a race condition caused by two separate HTTP requests:curl --headto check if the file existscurl -Lto actually download the fileBetween these requests, CDN caching or load balancing could serve different versions of the same file, causing the downloaded binary to have a different checksum than expected.
Solution
This PR eliminates the race condition by:
curl -L --failrequest - downloads directly with proper error handlingTesting
Changes
install.shdownload_release()functionThis is the safest possible fix as it completely eliminates the race condition window while maintaining backward compatibility and adding resilience against transient network issues.
Link to Devin run: https://app.devin.ai/sessions/d5d8ceb46c4b4f81adb6d94857c5bca2
Requested by: jhaynie@agentuity.com